package com.zhiyou100.taxi.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class CarIn implements Serializable {
    private String carInId;

    private String carOutId;
    private CarOut carOut;//汽车出租

    private String carCheckId;
    private CarCheck carCheck;//检测单管理

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date carInTime;

    private Double carInOil;

    private Short carInMoney;

    private String carInFeedback;

    private String userId;
    private User user;//用户信息

    private String carId;
    private Car car;//车辆信息

    private static final long serialVersionUID = 1L;

    public String getCarInId() {
        return carInId;
    }

    public void setCarInId(String carInId) {
        this.carInId = carInId == null ? null : carInId.trim();
    }

    public CarOut getCarOut() {
        return carOut;
    }

    public void setCarOut(CarOut carOut) {
        this.carOut = carOut;
    }

    public CarCheck getCarCheck() {
        return carCheck;
    }

    public void setCarCheck(CarCheck carCheck) {
        this.carCheck = carCheck;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public String getCarOutId() {
        return carOutId;
    }

    public void setCarOutId(String carOutId) {
        this.carOutId = carOutId == null ? null : carOutId.trim();
    }

    public String getCarCheckId() {
        return carCheckId;
    }

    public void setCarCheckId(String carCheckId) {
        this.carCheckId = carCheckId == null ? null : carCheckId.trim();
    }

    public Date getCarInTime() {
        return carInTime;
    }

    public void setCarInTime(Date carInTime) {
        this.carInTime = carInTime;
    }

    public Double getCarInOil() {
        return carInOil;
    }

    public void setCarInOil(Double carInOil) {
        this.carInOil = carInOil;
    }

    public Short getCarInMoney() {
        return carInMoney;
    }

    public void setCarInMoney(Short carInMoney) {
        this.carInMoney = carInMoney;
    }

    public String getCarInFeedback() {
        return carInFeedback;
    }

    public void setCarInFeedback(String carInFeedback) {
        this.carInFeedback = carInFeedback == null ? null : carInFeedback.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getCarId() {
        return carId;
    }

    public void setCarId(String carId) {
        this.carId = carId == null ? null : carId.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CarIn other = (CarIn) that;
        return (this.getCarInId() == null ? other.getCarInId() == null : this.getCarInId().equals(other.getCarInId()))
                && (this.getCarOutId() == null ? other.getCarOutId() == null : this.getCarOutId().equals(other.getCarOutId()))
                && (this.getCarCheckId() == null ? other.getCarCheckId() == null : this.getCarCheckId().equals(other.getCarCheckId()))
                && (this.getCarInTime() == null ? other.getCarInTime() == null : this.getCarInTime().equals(other.getCarInTime()))
                && (this.getCarInOil() == null ? other.getCarInOil() == null : this.getCarInOil().equals(other.getCarInOil()))
                && (this.getCarInMoney() == null ? other.getCarInMoney() == null : this.getCarInMoney().equals(other.getCarInMoney()))
                && (this.getCarInFeedback() == null ? other.getCarInFeedback() == null : this.getCarInFeedback().equals(other.getCarInFeedback()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getCarId() == null ? other.getCarId() == null : this.getCarId().equals(other.getCarId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCarInId() == null) ? 0 : getCarInId().hashCode());
        result = prime * result + ((getCarOutId() == null) ? 0 : getCarOutId().hashCode());
        result = prime * result + ((getCarCheckId() == null) ? 0 : getCarCheckId().hashCode());
        result = prime * result + ((getCarInTime() == null) ? 0 : getCarInTime().hashCode());
        result = prime * result + ((getCarInOil() == null) ? 0 : getCarInOil().hashCode());
        result = prime * result + ((getCarInMoney() == null) ? 0 : getCarInMoney().hashCode());
        result = prime * result + ((getCarInFeedback() == null) ? 0 : getCarInFeedback().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCarId() == null) ? 0 : getCarId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", carInId=").append(carInId);
        sb.append(", carOutId=").append(carOutId);
        sb.append(", carOut=").append(carOut);
        sb.append(", carCheckId=").append(carCheckId);
        sb.append(", carCheck=").append(carCheck);
        sb.append(", carInTime=").append(carInTime);
        sb.append(", carInOil=").append(carInOil);
        sb.append(", carInMoney=").append(carInMoney);
        sb.append(", carInFeedback=").append(carInFeedback);
        sb.append(", userId=").append(userId);
        sb.append(", user=").append(user);
        sb.append(", carId=").append(carId);
        sb.append(", car=").append(car);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}